<template>
  <div>
    <div class="baseform">
      <el-form :label-position="labelPosition" label-width="80px" :model="from">
        <!-- <el-form-item label="立案机构">
                        <el-input v-model="from.org"></el-input>
        </el-form-item>-->
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="车牌照颜色：">
              <el-input v-model="from.vehicleIdColor" placeholder="请输入车牌照颜色"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车型：">
              <el-select v-model="from.vehicleShipType" placeholder style="width: 100%">
                <el-option
                  v-for="item in carlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="运输证号">
              <el-input v-model="from.roadTransportLicense" placeholder="请输入"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="车籍所在地">
              <el-input v-model="from.vehicleRegister" placeholder="请输入" suffix-icon="fa fa-map-marker"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="车牌号码">
              <el-input v-model="from.vehicleShipId" placeholder="请输入车牌号"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>
<script>
import dictCache from "@/assets/utils/cache-dict-util";
import { mapActions } from "vuex";
export default {
  props: ["carlist"],
  data() {
    return {
      labelPosition: "right",
      from: {}
    };
  },

  mounted() {
    //   this.initPage();
  },
  methods: {
    ...mapActions("d2admin/page", ["close"]),
    initPage(detail){
      this.from = detail;
      this.setInitData();
      this.$forceUpdate();
    },
    setInitData(){  
        // this.
      if(!this.from.cartype){
        this.from.cartype = Object.values(this.cartypelist)[0].name;
        
      }
      if(this.from.vehicletotalweight){
        this.from.vehicletotalweight = '3000'
      }
    },
  }
};
</script>
<style lang="scss">
.baseform {
  padding: 0px 20%;
}
</style>
